package com.heaven.study.simplefactory;

public class OperatorFactory {

    public Operator getOperator(String strOperator) throws Exception {
        switch (strOperator) {
        case "+":
            return new Add();
        case "-":
            return new Minus();
        case "/":
            return new Divide();
        default:
            throw new Exception("Not support" + strOperator);
        }
    }
}
